const axios = require('axios')

async function testWalletAPI () {
  try {
    const token =
      'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsImlhdCI6MTczNTIxNjYyOSwiZXhwIjoxNzM1MzAzMDI5fQ._3qHHTbC-N6d_7M8h8QaQZZgTYOaM9Q67khBPBBgOQc'

    console.log('测试钱包API...')
    const response = await axios.get(
      'http://localhost:3000/api/payment/wallet',
      {
        headers: {
          Authorization: `Bearer ${token}`
        }
      }
    )

    console.log('✅ 钱包API测试成功:', response.data)
  } catch (error) {
    console.error('❌ 钱包API测试失败:', error.response?.data || error.message)
  }

  try {
    console.log('\n测试充值套餐API...')
    const response = await axios.get(
      'http://localhost:3000/api/payment/packages'
    )
    console.log('✅ 充值套餐API测试成功:', response.data)
  } catch (error) {
    console.error(
      '❌ 充值套餐API测试失败:',
      error.response?.data || error.message
    )
  }
}

testWalletAPI()
